package com.qfedu.fmmall.update.service.impl;

import com.qfedu.fmmall.entity.ProductSku;
import com.qfedu.fmmall.update.dao.ProductSkuDao;
import com.qfedu.fmmall.update.service.StockUpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : yanBin
 * @date :2022/1/25 16:42
 */
@Service
public class StockUpdateServiceImpl implements StockUpdateService {
    @Autowired
    private ProductSkuDao productSkuDao;

    @Override
    public int updateList(List<ProductSku> productSkuList) {
        int j = 1;
        for (ProductSku productSku : productSkuList) {
            int i = productSkuDao.updateByPrimaryKeySelective(productSku);
            j *= i;
        }
        return j;
    }


}
